package com.example.security_demo.filter;

import com.example.security_demo.utils.RequestWrapper;

import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

/**
 * 定制 request inputStream
 *
 * @author zzh
 * @date 2022/5/8
 * @since 1.0
 */
public class RequestWrapperFilter implements Filter {
    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {

        filterChain.doFilter(new RequestWrapper((HttpServletRequest) servletRequest), servletResponse);
    }
}
